function setLayout(){
  var winPad=10, elPad=10;
  
  $('.rounded').css({'padding':elPad});
  $('#masthead').css({ 'width' : $(window).width()-(2*winPad)-(2*elPad),
                       'top'   : winPad,
                       'left'  : winPad
                     });

  titleH=$('#page-title').outerHeight(true);
  $('#page-title').css({ 'top'  : ($('#masthead').innerHeight()/2)-(titleH/2),
                         'left' : $('#mastheadImg').width()+(2*elPad)
	                   });
	                   
  titleH=$('#header-context').outerHeight(true);
  $('#header-context').css({ 'top'   : ($('#masthead').innerHeight()/2)-(titleH/2),
                             'right' : winPad+elPad
	                       });	                   
                                          
  $('#left-menu').css({ 'top' : $('#masthead').outerHeight()+winPad+elPad,
                        'left': winPad
                      });
                      
  $('#content').css({ 'top'   : $('#masthead').outerHeight()+winPad+elPad,
                      'left'  : $('#left-menu').outerWidth()+winPad+elPad,
                      'width' : $(window).width()-(2*winPad)-$('#left-menu').outerWidth()-(3*elPad)
                    });
                    
  $('#footer').css({ 'top'   : $('#masthead').outerHeight()+winPad+(2*elPad)+$('#content').outerHeight(),
                     'left'  : winPad,
                     'width' : $(window).width()-(2*winPad)-(2*elPad)
                   });
                 
}

$(function(){
  setLayout();  	
  DD_roundies.addRule('.rounded','10px',true);
  DD_roundies.addRule('#left-menu a','5px',true);

  $('#mastheadImg').load(function(){
    setLayout();
  });
    
  $(window).resize(function(){
    setLayout();	  
  });
  
});